package com.iot.controller;


import com.iot.service.FastDfsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartRequest;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;

@Controller
public class MvAction {


    @Autowired
    private FastDfsService  fastDfsService;


    @RequestMapping("/upload")
    public @ResponseBody
    String uploadFile(MultipartRequest request) throws Exception {
         List<MultipartFile>   files = request.getFiles("fname1");

            fastDfsService.uploadFile(null,files);


        return "ok";

    }


}
